<template>
	<view class="london-bridge" :style="{height: Wheight + 'px'}">
		<view class="mass-texting-box">
			<view class="single-line">
				<text class="label">运营商：</text>
				<picker @change="bindPickerChange" :value="index" :range="array" range-key="name">
					<view class="selete-operator">{{ array[index].name }}</view>
				</picker>
			</view>
			
			<view class="single-line">
				<text class="label">目标城市：</text>
				<text @click="skip">{{ region }}</text>
			</view>
			
			<view class="single-line">
				<text class="label">目标号码：</text>
				<picker class="pier" @change="bindPickerChange2" :value="index" :range="piers" range-key="name">
					<view class="selete-operator">{{ piers[index2].name }}</view>
				</picker>
				<picker @change="bindPickerChange3" :value="index" :range="targetRoughlys" range-key="name">
					<view class="selete-operator">{{ targetRoughlys[index3].name }}</view>
				</picker>
			</view>
			
			<view class="single-line">
				<text class="label">生成方式：</text>
				<radio-group class="radio-group" @change="radioChange">
					<label class="label-item" v-for="(item, index) in items" :key="item.value">
						<radio :value="item.value" :checked="index === current" />
						<text>{{item.name}}</text>
					</label>
				</radio-group>
			</view>
			
			<view class="single-line">
				<text class="label">目标城市：</text>
				<slider class="slider" value="" @change="sliderChange" show-value />
			</view>
			
			
			<view class="single-line">
				<text class="label">手机号码：</text>
				<view class="right">
					<textarea
						v-model="messageContent" 
						:placeholder="messagePlaceholder"
						placeholder-class="textarea-message"
					/>
					<view class="right-bottom">
						<view class="amount">
							<text>已生成：0个</text>
						</view>
						<button type="primary" @click="skipTemplate">生成号码</button>
					</view>
				</view>
				
			</view>
			
			<view class="bottom-hint">
				* 靓号生成时可不用选择目标号段
			</view>
			<view class="bottom-hint">
				* 最近一次：运营商：中国移动，目标城市：北京市，目标号
				段：1343646，自定义靓号888，生成500个号码
			</view>
			
			
		</view>
		<view class="a-key-send">
			<view class="cambridge-blue common-button">导出Excel</view>
			<view class="dark-blue common-button">导入通讯录</view>
			<view class="cambridge-blue common-button">群发短信</view>
		</view>
	</view>
</template>

<script>
	export default {
		//同城商桥
		name: "londonBridge",
		data() {
			return {
				mustRead: `禁止发送色情、赌博、毒品、党政、维权、众筹、
					慈善募捐、宗教、迷信、股票、移民、保险、房地
					产、教育、培训、面试招聘、博彩、贷款、催款、
					信用卡提现、投资理财、中奖、抽奖、一元夺宝、
					一元秒杀、A货、整形、烟酒、交友、暴力、恐
					吓、色情、皮草、代开发票、代理注册、代办证
					件、加群、加QQ或者加微信、贩卖个人信息、运
					营商策反、流量营销等类型的短信`,
					targetIndustry: '',  //目标行业
					region: '', //目标城市
					phoneNum: 10,
					messageContent: '', //短信内容
					messagePlaceholder: '请点击按钮生成号码',
					//单选框的 数组
					items: [
						{
							value: '0',
							name: '有序'
						},{
							value: '1',
							name: '随机'
						},{
							value: '2',
							name: '靓号'
						}
					],
					remainingNum: 0, //剩余条数
					current: 0,
					array: [{ name: '中国移动' }, { name: '中国联通' },{ name: '中国电信' }],
					index: 0,
					index2: 0,
					index3: 0,
					piers: [{name: '130'},{name: '150'},{name: '189'}], //号码头
					targetRoughlys: [{name: '10300'}, {name: '10400'},{name: '10500'}], //目标号段
					Wheight: ''
			}
		},
		onLoad() {
			this.Wheight = this.$store.state.ContentHeight-44;
			//保存 目标行业
			this.targetIndustry = this.$store.state.targetIndustry;
			//保存 目标城市
			this.region = this.$store.state.region;
		},
		methods: {
			// 运营商 选择
			bindPickerChange(e) {
				console.log(e,"targetRoughlys")
				this.index = e.detail.value;
			},
			//号码头选择
			bindPickerChange2(e) {
				this.index2 = e.detail.value;
			},
			//号码字段选择
			bindPickerChange3(e) {
				this.index3 = e.detail.value;
			},
			//目标城市 跳转
			skip() {
				uni.navigateTo({
					url: '/pages/index/accurateSearch/addressBook'
				})
			},
			//生成方式 单选框 选择
			radioChange(evt) {
				console.log(evt)
			},
			 sliderChange(e) {
				console.log('value 发生变化：' + e.detail.value)
			}

		}
	}
</script>

<style lang="less" scoped>
	.london-bridge{
		background-color: #F6F5F5;
		.mass-texting-box{
			padding-bottom: 150rpx;
			.single-line{
				display: flex;
				align-items: center;
				padding: 30rpx;
				border-bottom: 1px solid #DBDBDB;
				background-color: #fff;
				text{
					font-size: 34rpx;
				}
				.right-flex{
					flex: 1;
				}
				.label{
					min-width: 160rpx;
					word-wrap: normal;
					flex-shrink: 0;
					margin-right: 50rpx;
				}
				.textarea-message{
					font-size: 34rpx;
					color: #999999;
				}
				.pier{
					margin-right: 40rpx;
				}
				.slider{
					flex: 1;
				}
				.right{
					flex: 1;
					textarea{
						width: auto;
						display: block;
					}
					.right-bottom{
						display: flex;
						align-items: center;
						.amount{
							text{
								font-size: 30rpx;
								&:first-child{
									margin-right: 10rpx;
								}
							}
						}
						button{
							width: 200rpx;
							height: 60rpx;
							line-height: 60rpx;
							background: #5696F8;
						}
					}
				}
				.radio-group{
					.label-item{
						margin-right: 30rpx;
						radio{
							margin-bottom: 20rpx;
						}
						
					}
				}
				.selete-operator{
					font-size: 34rpx;
				}
			}
			.bule{
				color: #5696F8;
			}
			.must-see{
				color: #333333;
				font-weight: 500;
			}
			.must-read-content{
				padding: 30rpx;
				color: #666666;
				line-height: 50rpx;
				font-size: 34rpx;
			}
			.bottom-hint{
				color: #666666;
				font-size: 26rpx;
				margin-top: 25rpx;
				padding: 0 30rpx;
			}
			
		}
		.a-key-send{
			position: fixed;
			bottom: 0;
			width: 100%;
			height: 100rpx;
			display: flex;
			align-items: center;
			line-height: 100rpx;
			.common-button{
				width: 249rpx;
				height: 100rpx;
				line-height: 100rpx;
				text-align: center;
				color: #fff;
				font-size: 36rpx;
			}
			.cambridge-blue{
				background: #88ABDA;
			}
			.dark-blue{
				background: #5696F8;
			}
		}
	}
</style>
